﻿/*///////////////////////////////////////////////////////////
CustomEvent.as
Ben Smith
2009
///////////////////////////////////////////////////////////*/

package com.bsmith.common 
{
	import flash.events.Event;
	
	/*===========================================================
	CustomEvent
	Event with custom data
	===========================================================*/
	public class CustomEvent extends Event 
	{
		private var _data:Object = { };	//Custom data
		
		/*-----------------------------------------------------------
		CustomEvent - ctor
		-----------------------------------------------------------*/
		public function CustomEvent(type:String, data:Object, bubbles:Boolean=false, cancelable:Boolean=false) 
		{ 
			super(type, bubbles, cancelable);
			_data = data;
		} 
		
		/*-----------------------------------------------------------
		clone
		-----------------------------------------------------------*/
		public override function clone():Event 
		{ 
			return new CustomEvent(type, _data, bubbles, cancelable);
		} 

		/*###########################################################
		GETTERS AND SETTERS
		###########################################################*/
		public function get data():Object { return _data; }
		public function set data(value:Object):void 
		{
			_data = value;
		}
	}
}